package com.slz3.business.module.configManagement.conIndexNewGoods.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.configManagement.conIndexNewGoods.domain.ConIndexNewGoods;
import com.slz3.business.module.configManagement.conIndexNewGoods.domain.ConIndexNewGoodsCondition;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

public class ConIndexNewGoodsResController {

    static Mono<ServerResponse> add(ServerRequest req, ConIndexNewGoods conIndexNewGoods) {
        if (ConIndexNewGoodsResUnsafeValid.add(req, conIndexNewGoods)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return ConIndexNewGoodsResAtomic.add_$ConIndexNewGoodsUpdateLock(req, conIndexNewGoods);
        }
    }

    static final Mono<ServerResponse> delete(ServerRequest req, ConIndexNewGoodsCondition conIndexNewGoodsCondition) {
        if (ConIndexNewGoodsResUnsafeValid.delete(req, conIndexNewGoodsCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return ConIndexNewGoodsResAtomic.delete_$ConIndexNewGoodsUpdateLock(req, conIndexNewGoodsCondition);
        }
    }

    static Mono<ServerResponse> modify(ServerRequest req, ConIndexNewGoods conIndexNewGoods) {
        if (ConIndexNewGoodsResUnsafeValid.modify(req, conIndexNewGoods)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return ConIndexNewGoodsResAtomic.modify_$ConIndexNewGoodsUpdateLock(req, conIndexNewGoods);
        }
    }

    static Mono<ServerResponse> list(ServerRequest req) {
        if (ConIndexNewGoodsResUnsafeValid.list(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return ConIndexNewGoodsResExecutor.list(req);
        }
    }

    static Mono<ServerResponse> info(ServerRequest req) {
        if (ConIndexNewGoodsResUnsafeValid.info(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return ConIndexNewGoodsResAtomic.info_$ConIndexNewGoodsUpdateLock(req);
        }
    }

    static Mono<ServerResponse> choice(ServerRequest req) {
        if (ConIndexNewGoodsResUnsafeValid.choice(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return ConIndexNewGoodsResExecutor.choice(req);
        }
    }

    static final Mono<ServerResponse> auditSubmit(ServerRequest req, ConIndexNewGoodsCondition conIndexNewGoodsCondition) {
        //
        if (ConIndexNewGoodsResUnsafeValid.auditSubmit(req, conIndexNewGoodsCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return ConIndexNewGoodsResAtomic.auditSubmit_$ConIndexNewGoodsUpdateLock(req, conIndexNewGoodsCondition);
        }
    }

    static final Mono<ServerResponse> audit(ServerRequest req, ConIndexNewGoodsCondition conIndexNewGoodsCondition) {
        if (ConIndexNewGoodsResUnsafeValid.audit(req, conIndexNewGoodsCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return ConIndexNewGoodsResAtomic.audit_$ConIndexNewGoodsUpdateLock(req, conIndexNewGoodsCondition);
        }
    }

    static final Mono<ServerResponse> auditReject(ServerRequest req, ConIndexNewGoodsCondition conIndexNewGoodsCondition) {
        if (ConIndexNewGoodsResUnsafeValid.auditReject(req, conIndexNewGoodsCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return ConIndexNewGoodsResAtomic.auditReject_$ConIndexNewGoodsUpdateLock(req, conIndexNewGoodsCondition);
        }
    }

    static final Mono<ServerResponse> usingEnable(ServerRequest req, ConIndexNewGoodsCondition conIndexNewGoodsCondition) {
        if (ConIndexNewGoodsResUnsafeValid.usingEnable(req, conIndexNewGoodsCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return ConIndexNewGoodsResAtomic.usingEnable_$ConIndexNewGoodsUpdateLock(req, conIndexNewGoodsCondition);
        }
    }

    static final Mono<ServerResponse> usingDisable(ServerRequest req, ConIndexNewGoodsCondition conIndexNewGoodsCondition) {
        if (ConIndexNewGoodsResUnsafeValid.usingDisable(req, conIndexNewGoodsCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return ConIndexNewGoodsResAtomic.usingDisable_$ConIndexNewGoodsUpdateLock(req, conIndexNewGoodsCondition);
        }
    }

}
